package com.example.demo.common.handler;

import com.example.demo.common.enums.BaseEnum;

/**
 * @Author: ak
 * @Date: 2020/4/1 0:22
 */
public class CustomException extends Exception{
    private String msg;
    private Integer code;
    public CustomException(BaseEnum baseEnum){
        super(baseEnum.getMsg());
        this.msg = baseEnum.getMsg();
        this.code=baseEnum.getCode();
    }
    public CustomException(String msg,Integer code){
        super(msg);
        this.msg=msg;
        this.code=code;
    }

    public String getMsg() {
        return msg;
    }

    public Integer getCode() {
        return code;
    }
}
